#include<iostream>
#include"namesp.h"

namespace pers
{
	void getPerson(Person& rp)
	{
		std::cout << "Enter the first name:" << std::endl;
		std::cin >> rp.fname;
		std::cout << "Enter the last name:" << std::endl;
		std::cin >> rp.lname;
	}
	void showPerson(const Person& rp)
	{
		std::cout << rp.fname << " , " << rp.lname;
	}
}


namespace debts
{
	void getDebt(Debt& rd)
	{
		getPerson(rd.name);
		std::cout << "Enter debt:" << std::endl;
		std::cin >> rd.amount;
	}

	void showDebt(const Debt& rd)
	{
		showPerson(rd.name);
		std::cout << " :  $ " << rd.amount << std::endl;
	}

	double sumDebt(const Debt ar[], int n)
	{
		double total = 0;
		for (int i = 0; i < n; i++)
			total += ar[i].amount;
		return total;
	}
}